import request from '@/utils/request'

// 查询用车明细列表
export function listDetails(query) {
  return request({
    url: '/usecar/details/list',
    method: 'get',
    params: query
  })
}

// 查询用车明细详细
export function getDetails(id) {
  return request({
    url: '/usecar/details/' + id,
    method: 'get'
  })
}

// 新增用车明细
export function addDetails(data) {
  return request({
    url: '/usecar/details',
    method: 'post',
    data: data
  })
}

// 拼车
export function addPin(data) {
  return request({
    url: '/usecar/details/carPool',
    method: 'post',
    data: data
  })
}

// 修改用车明细
export function updateDetails(data) {
  return request({
    url: '/usecar/details',
    method: 'put',
    data: data
  })
}

// 删除用车明细
export function delDetails(id) {
  return request({
    url: '/usecar/details/' + id,
    method: 'delete'
  })
}

// 查询地点下拉树结构
export function placeTreeSelect(detailsCarId) {
  return request({
    url: '/usecar/details/placeTree/'+detailsCarId,
    method: 'get'
  })
}

// 查询司机下拉树结构
export function driverTreeSelect() {
  return request({
    url: '/usecar/details/driverTree',
    method: 'get'
  })
}

// 查询车型下拉树结构
export function carTreeSelect() {
  return request({
    url: '/usecar/details/carTree',
    method: 'get'
  })
}
